/**
 * $HeadURL: http://jcachezen.googlecode.com/svn/trunk/src/net/jcachezen/CacheEntryJcz.java $
 */
package net.jcachezen;

import java.io.Serializable;
import java.util.Map;

import javax.cache.CacheEntry;

/** 
 * @since Sep 15, 2006
 * @lastCheckin $LastChangedDate: 2006-09-15 20:34:08 +0000 (Fri, 15 Sep 2006) $
 * @lastAuthor $LastChangedBy: david.mcreynolds $
 * @version $LastChangedRevision: 17 $
 */
public class CacheEntryJcz implements CacheEntry, Serializable {

	private long lastAccessTime = System.currentTimeMillis();
	private long lastUpdateTime = System.currentTimeMillis();
	private long creationTime = System.currentTimeMillis();
	private long expirationTime = System.currentTimeMillis();
	private long version;
	private Object key;
	private Object value;
	private int hits;
	private boolean valid;
	private long cost;
	/**
	 * @param value the value to set
	 */
	public Object setValue(Object value) {
		return this.value = value;
	}
	/**
	 * @return the version
	 */
	public long getVersion() {
		return version;
	}
	/**
	 * @param version the version to set
	 */
	public void setVersion(long version) {
		this.version = version;
	}
	/**
	 * @return the cost
	 */
	public long getCost() {
		return cost;
	}
	/**
	 * @return the creationTime
	 */
	public long getCreationTime() {
		return creationTime;
	}
	/**
	 * @return the expirationTime
	 */
	public long getExpirationTime() {
		return expirationTime;
	}
	/**
	 * @return the hits
	 */
	public int getHits() {
		return hits;
	}
	/**
	 * @return the key
	 */
	public Object getKey() {
		return key;
	}
	/**
	 * @return the lastAccessTime
	 */
	public long getLastAccessTime() {
		return lastAccessTime;
	}
	/**
	 * @return the lastUpdateTime
	 */
	public long getLastUpdateTime() {
		return lastUpdateTime;
	}
	/**
	 * @return the valid
	 */
	public boolean isValid() {
		return valid;
	}
	/**
	 * @return the value
	 */
	public Object getValue() {
		return value;
	}
	/**
	 * @param obj
	 * @return
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		return key.equals(obj);
	}
	/**
	 * @return
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return key.hashCode();
	}
}
